/*
 * comlan
 */

package com.promfy.bughunter.views;


import java.util.Locale;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.res.Configuration;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.promfy.bughunter.BugHunterActivity;
import com.promfy.bughunter.R;

public class GameModeView extends LinearLayout implements OnClickListener{

	private LayoutInflater inflater;
	private Context context;
	private View view;

	private Handler handler = new Handler(){

		@Override
		public void handleMessage(Message msg) {
			int what = msg.what;
			switch (what) {
			
			default:
				break;
			}
			super.handleMessage(msg);
		}
		
	};
	private TextView tv1;
	private TextView tv2;
	
	private static GameModeView gameModeView;
	
	public static GameModeView getInstance(Context context){
		if(gameModeView == null){
			gameModeView = new GameModeView(context);
		}
		return gameModeView;
	}
	
	public GameModeView(Context context) {
		super(context);
		this.context = context;

		initView();
		initData();
	}

	
	
	public GameModeView(Context context, AttributeSet attrs) {
		super(context, attrs);
		// TODO Auto-generated constructor stub
	}



	private void initView(){
		inflater = LayoutInflater.from(context);
		view = inflater.inflate(R.layout.game_mode, this);
		tv1 = (TextView)view.findViewById(R.id.tv1_game_mode);
		tv2 = (TextView)view.findViewById(R.id.tv2_game_mode);
		
		tv1.setOnClickListener(this);
		tv2.setOnClickListener(this);
	}
	
	private void initData() {
		
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.tv1_game_mode:
			((BugHunterActivity)context).onState(BugHunterActivity.STATUS_GAME_PLAYING);
			break;
		case R.id.tv2_game_mode:
			
			break;
			
		default:
			break; 
		}
	}

	public void onState(int status){
	
	}

}
